﻿using System;
using System.Collections.Generic;
using System.Text;

namespace LumaQQ.NET.Packets.In._08
{
    /**
 * <pre>
 * 修改信息的回复包，格式是
 * 1. 头部
 * 2. 我的QQ号的字符串形式（成功了就应该是我的QQ号，否则就是失败了）
 * 3. 尾部
 * </pre>
 *
 * @author luma
 */
    public class _08ModifyInfoReplyPacket : _08BasicInPacket
    {
        public bool Success { get; private set; }
        public int QQ { get; set; }
        public _08ModifyInfoReplyPacket(ByteBuffer buf, int length, QQUser user)
            : base(buf, length, user)
        {
        }
        public override string PacketName
        {
            get
            {
                return "Modify Info Reply _08Packet";
            }
        }
        protected override void ParseBody(ByteBuffer buf)
        {
            byte[] b = buf.ToByteArray();
            QQ = Utils.Util.GetInt(Utils.Util.GetString(b), 0);
            //        System.out.println(new String(b));
            if (QQ == user.QQ)
                Success = true;
            else
                Success = false;
        }
    }
}
